MVME-5500 Flash Programming Procedure  (by JWR, modified by BKT)


The MVME-5500 has a different monitor program than the familiar PPC-Bug
that we've all come to know on previous Motorola PowerPC VME SBC's.  The
program on the MVME-5500 is called MOTLOAD.  In the past, we've used
PPC-Bug to in-place program one of the 2 banks of boot flash with the
VxWorks bootrom image.  With the MVME-5500, we will accomplish the same
with commands to MOTLOAD.


Board Information and setup:

The MVME-5500 has many jumpers and switches.  For this procedure, we
need only be concerned with switch block S1 and jumper J8.  Please refer
to MTS drawing 572047 for the location of S1 and J8.

S1 is a software readable header that the boot code inspects as it
starts up and, based on the settings of these switches, it configures
the VxWorks bootline and the serial port as per the processor number
chart on drawing 572047.  In general, most systems will have all S1
switches set to the ON position.  This will result in the MTS standard
793 compatible bootline being used upon board boot.  On occasion, it
will be necessary to customize the bootline.  To accomplish this, S1-6
needs to be set to OFF AND the target name needs to be something other
than 'target0', or 'target1', etc.  I've used 't0', 't1', etc. as the
target name to meet this need.  If both these conditions are not met,
your bootline changes will be overwritten by the bootcode with the
standard 793 type bootline upon next reboot.

Jumper J8 determines the flash bank from which the processor will boot.
There are two banks of flash on the board.   They are known as flash0
and flash1.  These labels are silkscreened on the PWA directly above J8
so it is very easy to know which bank is the boot bank.  By convention,
Flash bank 1 is programmed with the VxWorks bootrom and Flash 0 contains
MOTLOAD.


How to Flash the VxWorks bootrom:

MOTLOAD can be used in exactly the same manner as PPC-Bug to fetch and
burn a boot image located on a PC using TFTP, the only difference being
the commands and their syntax.

Start by setting jumper J8 to the Flash 0 position (1-2), install the
board in a chassis, connect a serial cable from the COM1 port on the
board to an available COM port on the PC.  Connect an Ethernet cable
from the ENET1 port on the board to a network adapter on the PC.  Ensure
you have either a cross cable for direct connection or hub or switch
between the PC and the PowerPC.

Open a terminal window on the PC (Hyperterm or equivalent).   Choose the
appropriate PC COM port and set the characteristics on it to 9600 baud,
no parity, 8 bits, 1 stop, and XON/XOFF flow control.

Power on the VME chassis, you should soon see a MOTLOAD prompt
("MVME5500>") on the terminal window.

Now start the TFTP server.  The Cisco one we have used for years works
fine.

Ensure that the TFTP server is serving on the correct adapter, i.e. the
one cabled to the PowerPC, by verifying the IP address in the title bar
and that it is rooted in the correct directory. Also make sure that the
TFTP server root directory to the correct BSP directory for your board.
Do this by selecting View, Options, and enter the location of the boot
image into the "TFTP server root directory" box.

Up to this point, this is the same procedure we have used since we
started in-place flash reprogramming of VxWorks boot roms.

This is where the specifics for the MVME-5500 begin.

First we have to retrieve the boot image from the PC and get it into
memory on the PowerPC, we do this with the tftpGet command.  This
command allows us to specify a client address (-c) a server address (-s)
an Ethernet device to use (-d) and filename to retrieve (-f).  The form
of the command is:

	tftpGet -c<client_IP_address> -s<server_IP_address>
		-d/dev/enet1 -f<boot_image_file_name>

An example of a 793 type setup assuming filename mv5500_2.bin:

	tftpGet -c148.150.203.191 -s148.150.203.190 -d/dev/enet1 -fmv5500_2.bin

You will see something like the following as the image gets transferred
from the host to the PowerPC.  Eventually you will get another MVME5500>
prompt.

	MVME5500> tftpGet -c148.150.203.191 -s148.150.203.190 -d/dev/enet1 -fmv5500_2.bin

	Network Loading from: /dev/enet1
	Loading File: mv5500_2.bin
	Load Address: 00695000
	Download Buffer Size = 00200000

	Client IP Address      = 148.150.203.191
	Server IP Address      = 148.150.203.190
	Gateway IP Address     = 148.150.203.253
	Subnet IP Address Mask = 255.255.255.0

	Network File Load in Progress...

	Bytes Received =&962800, Bytes Loaded =&962800
	Bytes/Second   =&481400, Elapsed Time =2 Second(s)

At this point, I like to ensure that the flash bank I intend to program
is not the one I booted from.  To get this information, we can use the
flashShow command:

	MVME5500> flashShow

The response will be something like this:

	Device-Name  Base-Address,Size  Device-Size,Count  Boot  Type
	/dev/flash0  F2000000,02000000  01000000,00000002  Yes   Intel 28F128
	/dev/flash1  FF800000,00800000  00400000,00000002  No    Intel 28F320

Here we see that we have in fact booted from flash0 which is what we
want since we are going to burn the image into flash1. To burn the image
into the flash we use the flashProgram command giving it the flash
device parameter (-d) and an offset (-o) and a size (-n).  Do not alter
the parameters for the offset and the number of bytes or you may render
the card inoperable.

	MVME5500> flashProgram -d/dev/flash1 -o00700100 -nfff00

	Source Starting/Ending Addresses      =00695000/00794EFF
	Destination Starting/Ending Addresses =FFF00100/FFFFFFFF
	Number of Effective Bytes             =000FFF00 (&1048320)

	Program Flash Memory (Y/N)? y

After you answer Y to the Program Flash Memory question, the card will
think for a while and then come back to the MVME5500> prompt.

You are now ready to power down the chassis, remove the card, switch J8
to flash1 (2-3), reinsert and turn on the power.  You should see the
familiar VxWorks boot screen.
 